﻿<?php
// Lay cac thong so cau hinh chung
include "../app_global.php";
// Lay cac hang so dung chung
include "../const.php";
//Ket noi database bang ADO
include "../connect_ado.php";
// Ham thuc hien lay ten file va hien thi noi dung
include "../isa-lib/isa-function/isa_public_function.php";
// Kiem tra NSD da login hay qua timeout chua
include "../test_login.php";
// Khoi tao cac bien session
include "../init_session.php";
include "../onegate_function.php";
// Lay cac thong so cau hinh rieng cho chuc nang nay
include "app_local.php";
// Lay cac hang so cua chuc nang nay
include "const.php";
//Dung de tao bo DEV-EDITOR
include_once $FOLDER_DEVEDIT_CLASS;
//if (!isset($_REQUEST['modal_dialog_mode'])) 
if ($_MODAL_DIALOG_MODE == 0){
	include "../dsp_header.php";
}else{
	include "../dsp_modal_dialog_header.php";
}
include "../connect.php";?>
<script src="../isa-lib/isa-js/isa_util.js" ></script>
<script src="js_af.js" ></script><?php
switch($fuseaction) {
	 case "DISPLAY_SINGLE_AF";	
		if ($v_is_granted_view){
			include "qry_single_creator_af.php";
			include "qry_all_agency_of_creator.php";
			include "qry_all_cate_of_creator.php";
			include "qry_single_af.php";
			include "dsp_single_af.php";	 
		}
		break;
	case "DISPLAY_SINGLE_APROVE_AF";	
		if ($v_is_granted_view){
			include "qry_single_approver_af.php";
			include "qry_all_agency_of_approver.php";
			include "qry_all_cate_of_approver.php";
			include "qry_single_af.php";
			include "dsp_single_approve_af.php";	 
		}
		break;
	 case "UPDATE_AF"; 
		include "act_update_af.php";
		break;		
	 case "APPROVE_AF"; 
		include "act_approve_af.php";
		break;			
	 case "DELETE_AF";
		include "act_delete_af.php"; 
		break;
	case "DISPLAY_PREVIEW";
		include "dsp_preview_single_af.php"; 
		break;
	case "DISPLAY_ALL_AF_CONCERN";
		include "qry_all_af_concern.php";
		include "dsp_all_af_concern.php";
		break;
	case "DISPLAY_ALL_AF_FOR_ADDING";
		include "qry_all_af_for_adding.php";
		include "dsp_all_af_for_adding.php";
		break;
	case "UPDATE_AF_CONCERN";
		include "act_update_af_concern.php";
		break;
		
	case "DELETE_AF_CONCERN";
		include "act_delete_af_concern.php";
		break;
	case "MOVE_AF_CONCERN_UPDOWN";
		include "act_move_af_concern_updown.php";
		break;	
 	 default:
 	 	if ($v_is_granted_view){
			//include "../list/agency/qry_all_agency.php";
			include "qry_all_agency.php";
			include "qry_all_cate.php";
			include "qry_all_af.php";
			include "dsp_all_af.php"; 
		}else{?>
			<script>
			alert('Bạn không có quyền thực hiện chức năng này');

			</script><?php 
		}
		break;
}
include "../disconnect.php";
if (!isset($_REQUEST['modal_dialog_mode'])) {
	include "../dsp_footer.php";
}else{
	include "../dsp_modal_dialog_footer.php";
}
?>